<template>
  <v-md-editor
    v-model="props.data.courseContent"
    height="85vh"
    @save="save"
    :include-level="include_level"
    autofocus
    default-show-toc
  ></v-md-editor>
</template>

<script setup>
import axios from "@/axios/index.js";
import {ElMessage} from "element-plus";
let include_level = [1,2,3,4,5]
let props = defineProps(["data"]);
function save() {
  axios
    .put(
      "api/v1/admin/course/courseContent",
      {
        id: props.data.id,
        courseContent: props.data.courseContent,
      },
      {
        headers: {
          "Content-Type": "application/json",
        },
      }
    )
    .then((res) => {
      ElMessage({
        message: res.data.message,
        type: "success",
        duration:1000
      });
    });
}


</script>

<style scoped>
</style>